def fn(arr: List[Int]): List[Int] = { for (i <- arr) yield { if (i % 2 == 0) i / 2 else i + 1 } }.toList
// println(fn(List(1,2,3,4,5,6,7,8)))
